package com.lvtu.monitor.dao.base;

import java.util.List;
import java.util.Map;


/** 
 * @Title: AbstractRepository.java 
 * @Package com.lvtu.monitor.dao.base 
 * @Description: TODO 
 * @author dengcheng 
 * @date 2015-5-25 下午4:07:32 
 * @version V1.0.0 
 */
public interface AbstractRepository {
	/**
	 * save 
	* @Description: TODO 
	* @author dengcheng 
	* @date 2015-5-25 下午5:54:24
	 */
	public void insert(Object obj); 
	/**
	 * batch save
	* @Description: TODO 
	* @author dengcheng 
	* @date 2015-5-25 下午5:54:34
	 */
	public <T> void batchInsert(List<Class<T>> list,Class<T> clazz);
    /**
     * query one by PK
    * @Description: TODO 
    * @author dengcheng 
    * @date 2015-5-25 下午5:54:42
     */
	public <T>T findOne(String id,Class<T> clazz);  
	
	/**
     * query muty
    * @Description: TODO 
    * @author dengcheng 
    * @date 2015-5-25 下午5:54:42
     */
    public <T>List<T> findAll(Class<T> clazz);  
    //public List<> findByRegex(String regex); 
    /**
     * rm by PK
    * @Description: TODO 
    * @author dengcheng 
    * @date 2015-5-25 下午5:55:06
     */
    public <T> void removeOne(String id,Class<T> clazz);  
//    public void removeAll();  
//    public void findAndModify(String id);
    
    <T> void updateOne(String id, Map<String, Object> updates, Class<T> clazz);
    
}
